/*
 * Copyright(C) 2019 FUYUN DATA SERVICES CO.,LTD. - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited
 * Proprietary and confidential
 * 该源代码版权归属福韵数据服务有限公司所有
 * 未经授权，任何人不得复制、泄露、转载、使用，否则将视为侵权
 */

//  应用列表
export interface IClientList {
  id: string;
  created: string;
  clientSecret: string;
  updatedAt: string;
  name: string;
  logoUrl: any;
  scope: any;
}

// 应用信息
export interface IClientInfo {
  id: string;
  createdAt: string;
  updatedAt: string;
  clientSecret?: string;
  name: string;
  logoUrl?: any;
  scope: any;
  authorizedGrantTypes: string;
  accessTokenValidity: string;
  refreshTokenValidity: string;
  resourceIds: string;
  encrypted: boolean;
  roles: Array<IRole | string>;
}

// 新增应用
export interface INewClient {
  name: string;
  logoUrl?: any;
  clientSecret: string;
}

// 权限
export interface IPermission {
  clientId?: string;
  client: IClientInfo;
  code: string;
  createdAt: string;
  description: string;
  id: string;
  updatedAt: string;
}

// 角色
export interface IRole {
  id: string;
  name: string;
  code: string;
  clientId?: string;
  client: IClientInfo;
  permissions: IPermission[];
  permissonIds?: string[];
}

// 添加权限
export interface IAddPermission {
  code: string;
  clientId: string;
  description: string;
}

// 新增角色
export interface INewRole {
  id?: string;
  name: string;
  code: string;
  clientId: string;
  permissonIds: string[];
}
